package com.chenfeng.service.impl;

import com.chenfeng.dataobject.ProductCategory;
import com.chenfeng.respository.ProductCategoryRespository;
import com.chenfeng.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:陈峰
 * @Despriction:
 * @Date:Created in 23:11 on 2018/1/23.
 * @ModifyBy:
 */
@Service
public class CategoryServiceImpl implements CategoryService {
   @Autowired
    ProductCategoryRespository productCategoryRespository;
    @Override
    public ProductCategory findOne(Integer category) {
        return productCategoryRespository.findOne(category);
    }

    @Override
    public List<ProductCategory> findAll() {
        return productCategoryRespository.findAll();
    }

    @Override
    public List<ProductCategory> findByCategoryTypeIn(List<Integer> category) {
        return productCategoryRespository.findByCategoryTypeIn(category);
    }

    @Override
    public ProductCategory save(ProductCategory productCategory) {
        return productCategoryRespository.save(productCategory);
    }
}
